﻿using System.Collections.Generic;
using System.Windows.Forms;
using Me.Amon.Uc;

namespace Me.Amon.POS.V
{
    public partial class WfKey : Form
    {
        public WfKey()
        {
            InitializeComponent();

            KeyPreview = true;
        }

        public void ShowKeys(List<Stroke<WPos>> keys)
        {
            foreach (var key in keys)
            {
                var item = new ListViewItem { Text = key.Key };
                item.SubItems.Add(new ListViewItem.ListViewSubItem { Text = key.Memo });
                LvKeys.Items.Add(item);
            }
            LvKeys.Items[0].Selected = true;
        }

        private void Shortcuts_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                Close();
            }
        }
    }
}
